/* Marat
Index npc
*/
var status = -1;
var mainmenu = "Hello, i am the SteadyMaple NPC Index!!\r\n I can link you to most NPC's in the game.\r\nSelect a Catergory below:  \r\n#L10##rSupport the server - Please read!!#k#l \r\n \r\n #b#L1001#Shops#l \r\n #L1002#Warps#l \r\n #L1003#Jobs#l#k"; 

function action(mode, type, selection) {
    if (mode == 1) {
	status++;
    } else {
	if (status == 2) {
	    cm.sendNext("test");
	}
	status--;
    }
    if (status == 0) {
	cm.sendSimple(mainmenu);
    } else if (status == 1) {

	  
    if (selection == 1001){ //Shops
    	cm.sendSimple("#b#L6#General Shop#l\r\n#L15#Weapon Shop#l\r\n#L13#Medal Seller#l \r\n#L14#Event Trophy Trader#l \r\n#L9#@cash item trader#l \r\n#L2#Coco the mapleleaf trader#l\r\n#L16#Vote Points#l\r\n#L12#Timeless/Reverse Exchange Shop#l");
	} else if (selection == 1002){ //Warps
	    cm.sendSimple("#b#L11#Warp to Free Market#l\r\n#L1#Town Warper#l \r\n#L7#Boss Warper/High level training warper#l");
	} else if (selection == 1003) { //Jobs
	    cm.sendSimple("#b#L0#Job Advancer?#l\r\n#L5#--> Aran AND Duel-Blade advancer!! <--#l\r\n#L8#Fourth Job skill giver!#l \r\n#L4#Cygnus Knight third job quest skill giver#l\r\n#L3#Reset NPC#l\r\n#L17#Aran/Evan Missing Skill giver#l");
	} else if (selection == 1) { // joyce
	}
	
	} else if (status ==2){
		if (selection == 0) { // How do I move?
	    status = -1;
	   cm.dispose();
	   cm.openNpc(9000020); //spinel
	   
	  } else if (selection == 1){ //teh warper
        cm.dispose();
        cm.openNpc(9270035);		

	} else if (selection == 2) { //coco
	     	   cm.dispose();
	   cm.openNpc(9000017);
	 } else if (selection == 3) { //reset
	     	   cm.dispose();
	   cm.openNpc(1052014);
	   	 } else if (selection == 4) { //cygus skill
	     	   cm.dispose();
	   cm.openNpc(1052015);
	

	   	 } else if (selection == 5) { //aran
	     	   cm.dispose();
	   cm.openNpc(9010000);
	    } else if (selection == 6) { //shop
	     	   cm.dispose();
	   cm.openShop(9999);
	   	    } else if (selection == 7) { //boss warper
	     	   cm.dispose();
	   cm.openNpc(9310016);
	   	   	    } else if (selection == 8) { //4th job
	     	   cm.dispose();
	   cm.openNpc(9310015);
	   	   	   	    } else if (selection == 9) { //cash item
	     	   cm.dispose();
	   cm.openNpc(9310017);
	   
	   	   	   	   	    } else if (selection == 10) { //donate
	     	   cm.dispose();
	   cm.openNpc(9310018);
	   	   	   	   	   	    } else if (selection == 11) { //fmwarp
	     	   cm.dispose();
	   cm.warp(910000000, 1);
	   	   	   	   	   	   	    } else if (selection == 12) { //TIMELESS/REVERSE SHOP
	     	   cm.dispose();
	   cm.openNpc(9330032);
	   	   	   	   	   	   	   	    } else if (selection == 13) { //medal seller
	     	   cm.dispose();
	   cm.openNpc(9330028);
	   	   	   	   	   	   	   	   	    } else if (selection == 14) { //trophy
	     	   cm.dispose();
	   cm.openNpc(9330031);
	   } else if (selection == 15) { // Weapon guy
	   	     	   cm.dispose();
	   cm.openShop(42);
	   } else if (selection == 16) { //Vote points
	   cm.dispose();
	   cm.openNpc(9330024);
	   } else if (selection == 17) { //aran/evan skills
		    var job = cm.getJob();
			if (job >= 2000 && job <= 2112){
			cm.teachSkill(21000002, 20, 20);
			cm.teachSkill(21000000, 10, 10);
			cm.teachSkill(21001003, 20, 20);
			cm.teachSkill(21100000, 30, 30);
			cm.teachSkill(21100002, 20, 20);
			cm.teachSkill(21100004, 20, 20);
			cm.teachSkill(21100005, 20, 20);
			cm.teachSkill(21110002, 20, 20);
			cm.sendNext("Enjoy your new aran skills =]");
		    }
			else if (job >= 2200 && job <= 2218){ 
			cm.teachSkill(22171000, 30, 30);
			cm.teachSkill(22171002, 30, 30); 
			cm.teachSkill(22171003, 30, 30);
			cm.teachSkill(22171004, 5, 5); 
			cm.teachSkill(22181000, 30, 30);
			cm.teachSkill(22181001, 30, 30);
			cm.teachSkill(22181002, 30, 30);
			cm.teachSkill(22181003, 10, 10);
			cm.sendNext("Enjoy your new evan skills =]");
			} else {
	   
			cm.sendNext("You are not a aran or evan.");
			}
			cm.dispose();
	   
	   
	   
	
}
}
}

